package com.codingvip.concurrent;

import java.util.concurrent.atomic.AtomicReference;

public class AtomicReference2 {
    private static String message = null;
    public static void main(String[] args) {
        message = "hst1";
        AtomicReference<String> reference1 = new AtomicReference<>(message);
        System.out.println(reference1.get());

        reference1.compareAndSet(message, "hst3");
        System.out.println("----" + reference1.get());
    }
}
